6.10.áInternal networking

Internal Networking is similar to host interface networking in that the VM can directly communicate with the outside world. However, the "outside world" is limited to other VMs which connect to the same internal network.

Even though technically, everything that can be done using internal networking can also be done using host interface networking, there are two good reasons why this extra mode was implemented:

  1. Security. In host interface networking mode, all traffic goes through an interface of the host system. It is therefore possible to attach a packet sniffer (such as Ethereal) to the host interface and log all traffic that goes over a given interface. If, for any reason, you prefer two or more VMs on the same machine to communicate privately, hiding their data from both the host system and the user, Host Interface Networking therefore is not an option.

  2. Speed. Internal networking is more efficient than host interface networking, as VirtualBox can directly transmit the data without having to send it through the host operating system's networking stack.

Internal networks are created automatically as needed, i.e. there is no central configuration. Every internal network is identified simply by its name. Once there is more than one active virtual network card with the same internal network ID, the VirtualBox support driver will automatically "wire" the cards and act as a network switch. The VirtualBox support driver implements a complete Ethernet switch and supports both broadcast/multicast frames and promiscuous mode.

In order to attach a VM's network card to an internal network, set its networking mode to "internal networking". There are two ways to accomplish this:

In any case, you will have to configure the (virtual) network cards in the guest operating systems that are participating in the internal network to use static IP addresses (because the internal network provided by VirtualBox does not support DHCP, like VirtualBox's NAT engine would). These IP addresses should use IP addresses on the same subnet (e.g. 192.168.2.1 and 192.168.2.2). You may have to deactivate guest firewalls in order to allow guests to communicate with each other.

As a security measure, the Linux implementation of internal networking only allows VMs running under the same user ID to establish an internal network.